package o;

import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.text.style.TypefaceSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import o.der.d;
import o.der.f;
import o.der.g;
import o.egj.a;

public class ehf extends cku {
    public Dialog onCreateDialog(Bundle bundle) {
        Builder ˋ = ˋ(getActivity());
        ˋ.setView(ˊ(getActivity()));
        Dialog create = ˋ.create();
        ayw.ˊ(create.getWindow());
        return create;
    }

    private View ˊ(Context context) {
        View inflate = LayoutInflater.from(context).inflate(g.ˏˏ, null);
        ˏ(inflate);
        ((TextView) inflate.findViewById(d.ˋʽ)).setText(context.getResources().getString(f.ˌˏ, new Object[]{Integer.valueOf(30)}));
        String string = context.getString(f.ʿ);
        CharSequence spannableString = new SpannableString(context.getString(f.ˍˎ, new Object[]{string}));
        ckl o_ckl = new ckl(context);
        a aVar = new a(context, 2, false);
        aVar.ˎ(axh.ˏ(context));
        o_ckl.ˏ(aVar.ˋ());
        int indexOf = spannableString.toString().indexOf(string);
        spannableString.setSpan(o_ckl, indexOf, string.length() + indexOf, 33);
        spannableString.setSpan(new ForegroundColorSpan(context.getResources().getColor(der.a.ˋ)), indexOf, string.length() + indexOf, 33);
        spannableString.setSpan(new TypefaceSpan(context.getResources().getString(f.ˍ)), indexOf, string.length() + indexOf, 33);
        TextView textView = (TextView) inflate.findViewById(d.ʽʼ);
        textView.setText(spannableString);
        textView.setMovementMethod(new c());
        textView.setHighlightColor(context.getResources().getColor(der.a.ʼ));
        return inflate;
    }

    private void ˏ(View view) {
        try {
            int ˎ = ewb.ˎ((Activity) view.getContext());
            view.setPadding(ˎ, 0, ˎ, 0);
        } catch (Exception e) {
            Logger.e("CancelProtocolDialog", e.toString());
        }
    }
}
